//
//  RWDefine.h
//  iconstruction-ios
//
//  Created by 81SK on 2023/2/9.
//

#ifndef RWDefine_h
#define RWDefine_h

#ifdef DEBUG
#define NSLog(...) NSLog(__VA_ARGS__)
#else
#define NSLog(...) {}
#endif

#define WS(weakSelf)  __weak __typeof(&*self)weakSelf = self;


#pragma mark - *****************************************  尺寸  *********************************************

#define SCREEN_SCALE                [[UIDevice currentDevice] rw_scale]
#define SCREEN_WIDTH                [[UIDevice currentDevice] rw_sreenWidth]
#define SCREEN_HEIGHT               [[UIDevice currentDevice] rw_sreenHeight]
#define SCREEN_MAX_LENGTH           [[UIDevice currentDevice] rw_sreenMaxLength]
#define SCREEN_MIN_LENGTH           [[UIDevice currentDevice] rw_sreenMinLength]
#define IS_IPHONE                   [[UIDevice currentDevice] rw_isPhone]
/// 刘海屏系列机型
#define IS_IPHONE_X_SERIES          [[UIDevice currentDevice] rw_isIPhoneXSeries]

/// 状态栏高度
#define RWStatusBarHeight           [[UIDevice currentDevice] rw_statusBarHeight]
/// NaviBar高度
#define RWNavigationBarHeight       [[UIDevice currentDevice] rw_navigationBarHeight]
/// 顶部内容安全距离（status + navi）
#define RWNavigationTopSafeValue    [[UIDevice currentDevice] rw_naviTopSafeValue]
/// 顶部内容安全距离（status + navi）
#define RWNavigationTopOffset       [[UIDevice currentDevice] rw_naviTopSpacingOffsetValue]
/// tabBar高度
#define RWTabBarHeight              [[UIDevice currentDevice] rw_tabBarHeight]
/// 底部内容安全距离（x => 34，x以下则为0）
#define RWTabbarBottomSafeValue     [[UIDevice currentDevice] rw_tabbarBottomSafeValue]

#pragma mark - *****************************************  通知  *********************************************

/// 发送NSNotificationCenter post请求
#define RWPOSTNOT(name1, object1, userInfo1)            [[NSNotificationCenter defaultCenter] postNotificationName:name1 object:object1 userInfo:userInfo1]

/// 添加NSNotificationCenter
#define RWADDNOT(observer1, selector1, name1, object1)  [[NSNotificationCenter defaultCenter] addObserver:observer1 selector:selector1 name:name1 object:object1]

/// 删除NSNotificationCenter
#define RWREMOVENOT(observer1, name1, object1)          [[NSNotificationCenter defaultCenter] removeObserver:observer1 name:name1 object:object1]

/// 清空当前对象的全部通知
#define RWCLEANNOT(observer1)                           [[NSNotificationCenter defaultCenter] removeObserver:observer1]

#pragma mark - *****************************************  公共对象  *********************************************

/// key window
#define RWMainWindow                                    [UIApplication sharedApplication].keyWindow

/// NSUserDefaults
#define RWUserDefaults                                  [NSUserDefaults standardUserDefaults]

#endif /* RWDefine_h */
